#open file,
#convert all substrings made up of 2 or more spaces into line breaks
#save file


inFileName = "file to reformat line breaks.txt"
outFileName = "with line breaks4.txt"
lineBreakChar = "\n"

inStream = open(inFileName)
txt = inStream.read()
inStream.close()

lengthDoc = txt.__len__()

for concatSpaces in range(lengthDoc,1,-1):
    txt = txt.replace(concatSpaces*" ",lineBreakChar)

outStream = open(outFileName,'w')
outStream.write(txt)
outStream.close()
